# -*- coding: utf8 -*-

_author_ = "boboxu"

if __name__=='__main__':
    '''
    添加工作路径
    引用自己写的模块
    '''
    import sys
    import os
    # 获取当前绝对路径
    curPath = os.path.abspath(os.path.dirname(__file__))
    rootPath = os.path.split(curPath)[0]+'\..'
    # 设置模块搜索路径为Root目录
    sys.path.append(rootPath)

from datetime import datetime
import time

# 自己的模块
from LQT.event_engine.event_engine_base import Event
from LQT.constant import EventType
from LQT.strategy_center.event_online_engine import *

class EventTimer(Event):

    _triggering=False

    def __init__(self):
        super().__init__(event_type=EventType.EVENT_TIMER.value)

    @classmethod
    def update_timer(cls, event):
        """
        更新当前时间驱动其他事件
        :param event:
        :return:
        """
        if (datetime.now()-event.event_data_dict["strategy_data"].now_time).total_seconds()>=1:
            now_time=datetime.now()
            struct_time=time.gmtime()
            event.event_data_dict["strategy_data"].now_time=now_time
            time_second=now_time.minute*60+now_time.second

            